package greendbgui

class ElectoralRoll 
{
	static mapping = 
	{
		table 'electoral_roll'
		columns 
		{
			date column:'compile_date'
			ward column:'ward'
		}
		version false
	}

	static hasMany = [electoralRollEntry:ElectoralRollEntry]

    static constraints = 
	{
    }

    Date date
    Ward ward

  	String toString()
	{
    	return ward.displayName + " " + date
  	}

    String getDisplayString()
    {
        return ward.displayName + " (" + date.format ("MMM yy") + ")"
    }
}
